package com.omd.client;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import com.omd.client.rel.task.ReleaseTask;
import com.omd.client.server.HttpServer;
import com.system.comm.utils.FrameSpringBeanUtil;

/**
 * 程序入口
 * @author yuejing
 * @date 2016年1月29日 下午4:11:39
 * @version V1.0.0
 */
public class BootStrap {

	@SuppressWarnings("resource")
	public static void main(String[] args) throws Exception {

		String[] locations = {
				"classpath*:/spring/applicationContext.xml",
				"classpath*:/spring/applicationContext-threadpool.xml"
		};
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(locations);
		context.start();
		
		ThreadPoolTaskExecutor threadPoolTaskExecutor = FrameSpringBeanUtil.getBean(ThreadPoolTaskExecutor.class);
		threadPoolTaskExecutor.execute(new Runnable() {
			@Override
			public void run() {
				new ReleaseTask().run();
			}
		});

		new HttpServer().run();

	}
}